<template>
  <el-upload
    class="upload-demo"
    drag
    action="https://run.mocky.io/v3/9d059bf9-4660-45f2-925d-ce80ad6c4d15"
    multiple
  >
  <!-- 透传非默认插槽（排除 default 和 tip）,也可以不使用filter过滤,直接透传所有插槽 -->
  <template v-for="name in Object.keys($slots).filter(n => n !== 'default' && n !== 'tip')" v-slot:[name]="scope">
    <slot :name="name" v-bind="scope || {}" />
  </template>

  <!-- tip 插槽：带后备内容 -->
  <template #tip="scope">
    <slot name="tip" v-bind="scope || {}">
      <!-- 后备内容 -->
      <div class="el-upload__tip">
        jpg/png files with a size less than 500kb
      </div>
    </slot>
  </template>

  <!-- 默认插槽：带后备内容 -->
  <template #default="scope">
    <slot name="default" v-bind="scope || {}">
      <!-- 后备内容 -->
      <el-icon class="el-icon--upload"><upload-filled /></el-icon>
      <div class="el-upload__text">
        Drop file here or <em>click to upload</em>
      </div>
    </slot>
  </template>
  </el-upload>
</template>